revdeck 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/CONTRIBUTING.md +108 -0
  3. package/LICENSE +21 -0
  4. package/README.md +262 -2
  5. package/README.ru.md +249 -0
  6. package/SECURITY.md +45 -0
  7. package/dist/cli.js +3226 -0
  8. package/dist/cli.js.map +7 -0
  9. package/dist/daemon.js +4002 -0
  10. package/dist/daemon.js.map +7 -0
  11. package/dist/mcp.js +901 -0
  12. package/dist/mcp.js.map +7 -0
  13. package/dist/ui/assets/index-BAejn_X6.js +10 -0
  14. package/dist/ui/assets/index-xv-zA2Sf.css +1 -0
  15. package/dist/ui/favicon.svg +4 -0
  16. package/dist/ui/index.html +16 -0
  17. package/docs/README.md +17 -0
  18. package/docs/adr/0001-daemon-first.md +64 -0
  19. package/docs/architecture.md +92 -0
  20. package/docs/configuration.md +123 -0
  21. package/docs/integrations.md +123 -0
  22. package/docs/protocol.md +102 -0
  23. package/docs/ru/README.md +17 -0
  24. package/docs/ru/adr/0001-daemon-first.md +62 -0
  25. package/docs/ru/architecture.md +92 -0
  26. package/docs/ru/configuration.md +121 -0
  27. package/docs/ru/integrations.md +122 -0
  28. package/docs/ru/protocol.md +102 -0
  29. package/docs/ru/threat-model.md +52 -0
  30. package/docs/screenshot.png +0 -0
  31. package/docs/screenshot.ru.png +0 -0
  32. package/docs/threat-model.md +53 -0
  33. package/examples/monorepo.yml +38 -0
  34. package/examples/simple.yml +36 -0
  35. package/examples/web-chat-core.yml +45 -0
  36. package/package.json +79 -4
  37. package/skills/revdeck/en/Criteria.md +265 -0
  38. package/skills/revdeck/en/Feedback.md +64 -0
  39. package/skills/revdeck/en/Review.md +157 -0
  40. package/skills/revdeck/en/Rules.md +75 -0
  41. package/skills/revdeck/en/SKILL.md +78 -0
  42. package/skills/revdeck/en/Sources.md +47 -0
  43. package/skills/revdeck/en/agents/openai.yaml +4 -0
  44. package/skills/revdeck/ru/Criteria.md +249 -0
  45. package/skills/revdeck/ru/Feedback.md +64 -0
  46. package/skills/revdeck/ru/Review.md +148 -0
  47. package/skills/revdeck/ru/Rules.md +69 -0
  48. package/skills/revdeck/ru/SKILL.md +73 -0
  49. package/skills/revdeck/ru/Sources.md +46 -0
  50. package/skills/revdeck/ru/agents/openai.yaml +4 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] - 2026-11-12
10
+
11
+ ### Added
12
+
13
+ - Reactions on platform comments: thread cards in the UI, `revdeck react --note <id> --emoji <name>`,
14
+ and the `reactions.list` / `reactions.toggle` RPC methods. Existing reactions and the current user's
15
+ choice are shown for GitLab and GitHub.
16
+ - `revdeck eject`: removes the config, installed skills and command files, the `revdeck` MCP entry and
17
+ the local cache from a repository. It is preview-only without `--yes` and leaves foreign files and
18
+ other MCP servers intact.
19
+ - Attachments for comments: the UI **Attach** button and `revdeck attach` upload images and videos
20
+ through the host daemon. GitLab project uploads return absolute URLs, relative `/uploads/` links are
21
+ normalized to the platform host during publish, and the sanitizer allows images only from that host.
22
+ Only raster images and videos with matching extension, MIME and file signature are accepted.
23
+ - Devcontainer support: `revdeck devcontainer --write` mounts the host runtime and state directories,
24
+ sets `REVDECK_*` variables and marks the container, so revdeck reuses the host daemon and never runs
25
+ `gh`/`glab` inside. `revdeck doctor` checks the host daemon in this mode; `revdeck daemon start
26
+ --host` exposes the HTTP UI, and `revdeck eject` removes the generated mounts/env.
27
+
28
+ ### Fixed
29
+
30
+ - `revdeck init` keeps one canonical skill in `.agents/skills/revdeck` (now including
31
+ `agents/openai.yaml`) and links `.claude/skills/revdeck` to it instead of copying the procedure files.
32
+ A copy is used only on platforms without symlink support.
33
+
34
+ ## [0.1.0] - 2026-11-11
35
+
36
+ First public release.
37
+
38
+ ### Added
39
+
40
+ - Daemon-first architecture: local daemon over a unix socket, SQLite state, multiple reviews.
41
+ - Providers for GitLab and GitHub via `glab`/`gh`: MR/PR info, unified diff, threads, replies,
42
+ resolve, reactions, line comments, general comments.
43
+ - Approval-gated, idempotent publishing: preview → plan hash → approve → commit.
44
+ - CLI: `init`, `doctor`, `daemon`, `list`, `open`, `context`, `diff`, `threads`, `summary`,
45
+ `findings`, `reply`, `notes`, `publish`, `rules`, `checks`, `export`, `import`, `ui`, `mcp`.
46
+ - MCP server with 13 tools, `review-mr` and `close-feedback` prompts.
47
+ - Svelte 5 UI: review queue, summary, threads with autosave, findings triage, virtualized-free diff
48
+ with line comments, rules, publish dialog, command palette, SSE updates.
49
+ - Configurable per-project rules: path → document/section mapping, auto-discovery, checks.
50
+ - Harness adapters for Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Copilot and DSH (MCP).
51
+ - Bilingual product: Russian and English UI with a switch, localized CLI/MCP/context, and separate
52
+ Russian/English skill packs selected by `revdeck init --lang`.
53
+ - `output.language: auto | ru | en` for review output, independent of the interface language.
54
+ - English documentation as the canonical set under `docs/`, with Russian translations under `docs/ru/`.
55
+ - Security: token scrubbing, redaction, publish sanitizer, loopback-only UI, one-time launch token,
56
+ cookie/Origin/Host checks, CSP.
57
+ - Docs: architecture, configuration, protocol, threat model, integrations, ADR.
58
+ - Tests: diff parser, core helpers, providers with recorded responses, service with a fake provider.
@@ -0,0 +1,108 @@
1
+ # Contributing to revdeck
2
+
3
+ Thanks for taking the time to contribute. revdeck is a small, dependency-light project: a review
4
+ procedure, a local daemon, platform providers, an MCP server, a CLI and a Svelte UI.
5
+
6
+ ## Good first issues
7
+
8
+ - A new `Provider` (Bitbucket, Forgejo, Azure DevOps).
9
+ - A harness adapter (Gemini, Zed, JetBrains, a DSH host command).
10
+ - Native drafts for GitLab/GitHub.
11
+ - English translations of `docs/` and `skills/`.
12
+ - UI: reactions panel, review opening dialog, virtualized diff.
13
+
14
+ ## Setup
15
+
16
+ ```bash
17
+ git clone https://github.com/katrov/revdeck.git
18
+ cd revdeck
19
+ npm ci
20
+ npm run typecheck # tsc + svelte-check
21
+ npm test
22
+ npm run build
23
+ ```
24
+
25
+ For manual testing, `npm run dev:daemon` starts the daemon from source; `npm run dev:ui` starts Vite.
26
+ The daemon serves the built UI from `dist/ui`, so run `npm run build:ui` before checking the full app.
27
+
28
+ `glab`/`gh` are optional for development: provider tests use recorded CLI responses. To test against a
29
+ real platform, authenticate the CLI and run `revdeck doctor`.
30
+
31
+ ## Project layout
32
+
33
+ | Path | Responsibility |
34
+ |---|---|
35
+ | `src/core` | Pure functions: diff parser, config, rules, findings, sanitizer, redaction, exec |
36
+ | `src/providers` | Platform-specific code; the only place that knows GitLab/GitHub JSON |
37
+ | `src/daemon` | SQLite store, review service, approvals, RPC, HTTP/SSE |
38
+ | `src/cli` | Commands and installers |
39
+ | `src/mcp` | MCP tools and prompts |
40
+ | `ui` | Svelte 5 SPA |
41
+ | `skills/revdeck` | Review procedures shipped to user projects |
42
+
43
+ Rules of thumb:
44
+
45
+ - Keep `src/core` free of network and platform assumptions.
46
+ - A provider returns normalized types from `src/core/types.ts`; no UI or CLI concerns.
47
+ - Publishing must stay approval-gated: never add a path that posts without an `approval_id`.
48
+ - Untrusted text (comments, diff, MR description) never becomes an instruction or a shell command.
49
+
50
+ ## Adding a provider
51
+
52
+ 1. Implement `Provider` from `src/providers/provider.ts`.
53
+ 2. Add a branch to `createProvider`.
54
+ 3. Add fixture-based tests in `tests/providers.test.ts` using a fake `Runner`.
55
+ 4. Document platform quirks (resolve, drafts, line comments) in `docs/architecture.md`.
56
+
57
+ ## Adding a harness adapter
58
+
59
+ Add a `SPECS` entry in `src/cli/init.ts` with the MCP config path, command file or `linkSkill` flag, then
60
+ document it in `docs/integrations.md`. The canonical skill is always `.agents/skills/revdeck`; adapters
61
+ link to it instead of copying the procedure files. `init` must never overwrite files it does not own.
62
+
63
+ ## Translations
64
+
65
+ - UI strings live next to their components: `t('русский', 'English')` in `ui/src/lib/i18n.svelte.ts`'s
66
+ `t` helper. Keep both languages in the same edit.
67
+ - CLI strings use `tr('русский', 'English')` from `src/core/locale.ts`.
68
+ - The skill has two human-maintained packs: `skills/revdeck/ru/` and `skills/revdeck/en/`. They must
69
+ keep the same structure and semantics; do not machine-translate the review procedure.
70
+ - Tests that assert message text should pin the locale with `setLocale('ru')` or be language-agnostic.
71
+ - Docs: `docs/` is English and canonical, `docs/ru/` is Russian. Keep headings, commands, code blocks
72
+ and file paths identical between the two; translate prose only.
73
+
74
+ ## Pull requests
75
+
76
+ - One logical change per PR; include tests for behavior changes.
77
+ - `npm run typecheck`, `npm test` and `npm run build` must pass.
78
+ - Do not commit secrets, `.env` files, tokens, or generated `dist/` artifacts.
79
+ - UI changes: include a screenshot and check light/dark themes.
80
+ - Commits: imperative mood, short subject, explain the *why* in the body. Conventional Commits
81
+ prefixes (`feat:`, `fix:`, `docs:`, `test:`, `refactor:`) are welcome but not required.
82
+ - By contributing you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
83
+
84
+ ## Release (maintainers)
85
+
86
+ ```bash
87
+ npm version minor
88
+ git push --follow-tags
89
+ ```
90
+
91
+ The `release` workflow publishes to npm with provenance and creates a GitHub release. It uses
92
+ [trusted publishing](https://docs.npmjs.com/trusted-publishers): GitHub Actions gets a short-lived
93
+ OIDC token, so no npm token is stored in the repository and provenance is generated automatically.
94
+
95
+ Requirements, all configured once on npmjs.com (package `revdeck` → Settings → Trusted publishing):
96
+
97
+ - publisher `katrov/revdeck`, workflow file `release.yml`, environment left empty;
98
+ - "stage only" disabled, so tagged releases publish straight away.
99
+
100
+ The workflow runs on Node 24 and installs npm >= 11.15 because trusted publishing requires npm
101
+ 11.5.1 or newer. If `id-token` is not writable the "Verify OIDC permissions" step fails with a
102
+ clear error; `ENEEDAUTH` from npm means the trusted publisher entry does not match the repo,
103
+ workflow file or environment. The version in `src/version.ts` must match `package.json`.
104
+ `prepublishOnly` re-runs build, typecheck and tests.
105
+
106
+ ## Security
107
+
108
+ Please do not open a public issue for a vulnerability. See [SECURITY.md](SECURITY.md).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 revdeck contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,263 @@
1
- # Temporary Holding Version
1
+ # revdeck
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/revdeck.svg)](https://www.npmjs.com/package/revdeck)
4
+ [![CI](https://github.com/katrov/revdeck/actions/workflows/ci.yml/badge.svg)](https://github.com/katrov/revdeck/actions/workflows/ci.yml)
5
+ [![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
+ [![node](https://img.shields.io/node/v/revdeck.svg)](https://nodejs.org)
7
+
8
+ **Agent-first code review for GitLab and GitHub.**
9
+
10
+ revdeck gives an agent the review context and the project's own rules, lets it write findings and
11
+ replies, and keeps publishing under human control. It runs as a local daemon with a CLI, an MCP server
12
+ and a web UI. Platform tokens stay on the host.
13
+
14
+ ![revdeck UI](docs/screenshot.png)
15
+
16
+ [Русская версия](README.ru.md) · [Documentation](docs/README.md) (English and Russian)
17
+
18
+ ## Why
19
+
20
+ - **Rules, not vibes.** For every changed path revdeck selects the repository documents and the exact
21
+ sections (`AGENTS.md`, architecture, style guides, ADRs). The agent gets a deterministic, size-limited
22
+ context instead of generic “review this PR” instructions.
23
+ - **Humans publish.** The agent writes drafts. The UI shows exactly what will be posted; publishing is
24
+ bound to a hash of the plan and is idempotent. There is no “agent approved its own comment” path.
25
+ - **Tokens never reach the agent.** The daemon calls `glab`/`gh` on the host and scrubs platform tokens
26
+ from child environments. A sandboxed agent only gets an RPC.
27
+ - **GitLab and GitHub.** One model: MR/PR, threads, diff, resolve, reactions, line comments, attachments.
28
+ - **Many reviews.** The daemon keeps them in SQLite; the UI is a triage queue with keyboard shortcuts.
29
+ - **Any harness.** MCP tools for MCP clients, the same capabilities over CLI, and a skill that carries
30
+ the review procedure.
31
+
32
+ ## How it works
33
+
34
+ ```
35
+ agent (MCP/CLI) ──unix socket──▶ revdeck daemon ──glab/gh──▶ GitLab / GitHub
36
+ │
37
+ SQLite + Svelte UI ◀── human
38
+ ```
39
+
40
+ ## Install
41
+
42
+ Requirements: Node.js ≥ 22.13 (Node 24 LTS recommended — `node:sqlite` is experimental in 22.x), `git`, and an authenticated platform CLI
43
+ (`glab auth login` or `gh auth login`). revdeck never reads or stores their tokens.
44
+
45
+ ```bash
46
+ # one-off
47
+ npx revdeck@latest init
48
+
49
+ # or install globally for daily use
50
+ npm install -g revdeck
51
+ revdeck init
52
+ ```
53
+
54
+ In a repository:
55
+
56
+ ```bash
57
+ cd /path/to/repo
58
+ revdeck init # .revdeck.yml, skill for your harnesses, MCP config
59
+ revdeck doctor # node, glab/gh auth, daemon, adapters
60
+ revdeck open 42 # load an MR/PR
61
+ revdeck ui # open the local UI
62
+ ```
63
+
64
+ `init` never overwrites an existing config without `--force`, and it merges `.mcp.json` instead of
65
+ replacing it. `revdeck eject` is the inverse: it removes the config, installed skills and command files,
66
+ the `revdeck` MCP entry and the local `.revdeck/` cache, leaving foreign files and other MCP servers
67
+ untouched. It only shows the plan by default; add `--yes` to apply (`--keep-config` keeps
68
+ `.revdeck.yml`). Auto-start on login: `revdeck daemon install` (systemd user unit on Linux, launchd
69
+ plist on macOS). Use a global install for this — an `npx` cache path can be evicted.
70
+
71
+ ## Languages
72
+
73
+ The product is bilingual (Russian and English), and the two languages are independent:
74
+
75
+ - **Interface and CLI**: follow `--lang ru|en`, then `REVDECK_LANG`, then the system locale. The UI has
76
+ a RU/EN switch in the sidebar and remembers your choice.
77
+ - **Review output** (findings, replies, summary): `output.language: auto | ru | en` in `.revdeck.yml`.
78
+ `auto` follows the language of the MR description and threads, so a Russian team can review an
79
+ English repo and still get Russian comments (or the other way round).
80
+ - **Skill**: `revdeck init --lang en` installs the English procedure; without the flag init follows
81
+ `REVDECK_LANG`/the system locale and defaults to English.
82
+ - **Project rules** can be written in any language: revdeck reads UTF-8 documents and matches headings
83
+ (including Cyrillic) without translation. Rules are quoted as-is.
84
+
85
+ MCP tool descriptions are English — that is the model-facing layer; prompt text follows
86
+ `REVDECK_LANG`. The daemon reads the language at startup, so restart it after changing the language
87
+ (`revdeck daemon restart`).
88
+
89
+ Documentation is available in English (`docs/`, canonical) and Russian (`docs/ru/`). English and
90
+ Russian READMEs live in this repository; translation fixes are welcome.
91
+
92
+ ## Commands
93
+
94
+ | Command | What it does |
95
+ |---|---|
96
+ | `revdeck init` | config, harness adapters, MCP |
97
+ | `revdeck eject [--yes]` | remove revdeck-owned config, adapters and MCP entry |
98
+ | `revdeck devcontainer [--write]` | mount the host daemon socket/state into a devcontainer |
99
+ | `revdeck doctor` | environment, `glab`/`gh` auth, daemon, adapters |
100
+ | `revdeck list [--remote]` | tracked reviews or open ones from the platform |
101
+ | `revdeck open <N\|URL>` | load a review |
102
+ | `revdeck context <N>` | agent context: rules, files, threads, findings |
103
+ | `revdeck diff <N> [--file]` | files and hunks |
104
+ | `revdeck threads <N>` | discussions |
105
+ | `revdeck findings <N> set --file f.json` | write findings |
106
+ | `revdeck reply <N> --thread <id> --body …` | draft a reply |
107
+ | `revdeck publish <N> [--yes]` | preview or publish after confirmation |
108
+ | `revdeck notes <N> …` | line comments from the human |
109
+ | `revdeck react <N> --note <id> --emoji <name>` | toggle a reaction on a platform comment |
110
+ | `revdeck attach <N> --file <image-or-video>` | upload an attachment and print its markdown link |
111
+ | `revdeck rules [--explain <path>]` | effective rules |
112
+ | `revdeck checks <N> [--run --yes]` | project checks |
113
+ | `revdeck export/import <N>` | legacy file exchange |
114
+ | `revdeck ui [N]` | local web UI |
115
+ | `revdeck daemon <start\|stop\|status\|logs\|install>` | daemon lifecycle |
116
+ | `revdeck mcp` | MCP server over stdio |
117
+
118
+ Common flags: `--json`, `--root`, `--review`, `--platform`, `--project`, `--host`, `--lang ru|en`.
119
+
120
+ ## Attachments
121
+
122
+ The UI has an **Attach** button next to reply, finding and line-comment editors; the CLI equivalent is
123
+ `revdeck attach <N> --file shot.png`. The file is uploaded by the daemon on the host, and the editor
124
+ receives a markdown link with an absolute platform URL, so GitLab renders images and videos in the
125
+ original MR. Relative GitLab `/uploads/...` links in existing drafts are rewritten to
126
+ `https://<host>/uploads/...` during the publish preview.
127
+
128
+ GitLab is supported through project uploads (requires a `glab` with `--form` support). GitHub has no
129
+ public attachment API, so the button is disabled there and a link must be pasted manually. Only raster
130
+ images and videos (PNG, JPEG, GIF, WebP, AVIF, MP4, WebM, OGV, MOV) are accepted; SVG and arbitrary
131
+ files are rejected.
132
+
133
+ ## Devcontainer
134
+
135
+ The daemon, `glab` and `gh` stay on the host. From the repository root:
136
+
137
+ ```bash
138
+ revdeck devcontainer # print the mounts and environment
139
+ revdeck devcontainer --write # merge them into .devcontainer/devcontainer.json
140
+ ```
141
+
142
+ The command mounts the host runtime directory at `/run/revdeck` (socket) and the state directory at
143
+ `/var/lib/revdeck` (read-only `daemon.json`), and sets `REVDECK_RUNTIME_DIR`, `REVDECK_STATE_DIR`,
144
+ `REVDECK_DEV_CONTAINER=1` and `REVDECK_UI_HOST`. After rebuilding the container, start the daemon on
145
+ the host. Inside the container revdeck never starts a local daemon, so `gh`/`glab` are never invoked
146
+ there; if the host socket is missing it fails with a clear `DEVCONTAINER` error. `revdeck doctor` is
147
+ aware of this mode. For the UI from the container, start the host daemon with
148
+ `revdeck daemon start --host 0.0.0.0`.
149
+
150
+ ## MCP
151
+
152
+ ```json
153
+ {
154
+ "mcpServers": {
155
+ "revdeck": {
156
+ "command": "npx",
157
+ "args": ["-y", "revdeck", "mcp"],
158
+ "env": { "REVDECK_LANG": "en" }
159
+ }
160
+ }
161
+ }
162
+ ```
163
+
164
+ Tools: `revdeck_status`, `revdeck_list`, `revdeck_open`, `revdeck_context`, `revdeck_threads`,
165
+ `revdeck_diff`, `revdeck_rules`, `revdeck_draft_reply`, `revdeck_draft_findings`,
166
+ `revdeck_set_summary`, `revdeck_notes`, `revdeck_publish_preview`, `revdeck_publish`.
167
+
168
+ Publishing requires an `approval_id` that only a human can create (UI or CLI `--yes`). The MCP tool
169
+ does not create one. Prompts `review-mr` and `close-feedback` are available in clients that support
170
+ MCP prompts.
171
+
172
+ Harness matrix and slash commands: [docs/integrations.md](docs/integrations.md).
173
+
174
+ ## Rules
175
+
176
+ `.revdeck.yml` at the repository root:
177
+
178
+ ```yaml
179
+ version: 1
180
+ output:
181
+ language: auto # auto | ru | en — язык замечаний и ответов
182
+ provider:
183
+ type: gitlab # auto | gitlab | github
184
+ host: gitlab.example.com
185
+ project: group/project
186
+ base: develop
187
+ rules:
188
+ sources: [AGENTS.md, CONTRIBUTING.md]
189
+ map:
190
+ - match: "src/**"
191
+ docs: [docs/Architecture.md, "docs/Styleguide.md#Базовый стиль"]
192
+ - match: "src/state/**"
193
+ docs: [docs/StateManagement.md]
194
+ ignore: ["**/generated/**"]
195
+ checks:
196
+ - id: lint
197
+ argv: [npm, run, lint]
198
+ when: ["src/**"]
199
+ publish:
200
+ requireApproval: true
201
+ maxComments: 50
202
+ ```
203
+
204
+ Document selectors: `docs/File.md`, `docs/File.md#Heading`, `docs/File.md#L10-L25`. Without a config,
205
+ revdeck discovers `AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md` and `docs/*` and warns when nothing is
206
+ found. Full schema: [docs/configuration.md](docs/configuration.md).
207
+
208
+ ## Security
209
+
210
+ - The daemon listens on loopback and a unix socket (0600). The UI uses a one-time launch token, an
211
+ `HttpOnly`/`SameSite=Strict` cookie, `Host`/`Origin` checks and CSP.
212
+ - `glab`/`gh` run without a shell, with `cwd` outside the working copy and a scrubbed environment;
213
+ secrets are redacted from logs and errors.
214
+ - Comments are checked for GitLab quick actions, HTML, hidden/bidi characters, mass mentions and
215
+ external images (only uploads from the platform host are allowed).
216
+ - Review text is untrusted data; agent instructions say so explicitly.
217
+
218
+ Details: [docs/threat-model.md](docs/threat-model.md). The guarantee is: the token does not cross the
219
+ sandbox boundary and is not returned over RPC. If a process can read the user's home directory, it can
220
+ read the CLI configuration — isolate the agent.
221
+
222
+ ## Architecture
223
+
224
+ | Path | Contents |
225
+ |---|---|
226
+ | `src/core` | models, diff parser, rules compiler, findings, sanitizer, safe exec |
227
+ | `src/providers` | GitLab and GitHub via `glab`/`gh`, normalized |
228
+ | `src/daemon` | SQLite, service, unix-socket RPC, HTTP/SSE, approvals |
229
+ | `src/cli` | commands, `init`, `doctor`, export/import |
230
+ | `src/mcp` | MCP server over stdio |
231
+ | `ui` | Svelte 5 + Vite |
232
+ | `skills/revdeck` | review procedures (SKILL, Review, Feedback, Criteria, Rules, Sources, `agents/openai.yaml`) |
233
+
234
+ More: [docs/architecture.md](docs/architecture.md), [docs/protocol.md](docs/protocol.md),
235
+ [ADR-0001](docs/adr/0001-daemon-first.md).
236
+
237
+ ## Development
238
+
239
+ ```bash
240
+ npm ci
241
+ npm run typecheck # tsc + svelte-check
242
+ npm test # vitest
243
+ npm run build # dist/cli.js, dist/daemon.js, dist/mcp.js, dist/ui
244
+ npm run dev:daemon # daemon from source
245
+ npm run dev:ui # Vite dev server (the daemon serves dist/ui)
246
+ ```
247
+
248
+ Provider tests use recorded CLI responses and need no network. See [CONTRIBUTING.md](CONTRIBUTING.md).
249
+
250
+ ## Status
251
+
252
+ - Publishing uses regular comments; native drafts (GitLab draft notes, GitHub pending review) are not
253
+ used yet, though the provider interface is ready.
254
+ - Project checks are planned by the agent; running them requires `revdeck checks --run --yes`.
255
+ - The UI does not open a new review by number; use the CLI and the review appears in the list.
256
+ - Thread resolution is in the thread card; reactions are available on thread notes in the UI and through
257
+ `revdeck react`.
258
+ - GitHub has no public attachment API: the Attach button is disabled there; uploads work in GitLab.
259
+ - Auto-start is supported on Linux and macOS; on Windows run the daemon manually.
260
+
261
+ ## License
262
+
263
+ [MIT](LICENSE)